<%@ page import="allocator.Aluno" %>



<div class="fieldcontain ${hasErrors(bean: alunoInstance, field: 'nome', 'error')} required">
	<label for="nome">
		<g:message code="aluno.nome.label" default="Nome" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="nome" maxlength="50" required="" value="${alunoInstance?.nome}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: alunoInstance, field: 'matricula', 'error')} required">
	<label for="matricula">
		<g:message code="aluno.matricula.label" default="Matricula" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="matricula" pattern="${alunoInstance.constraints.matricula.matches}" required="" value="${alunoInstance?.matricula}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: alunoInstance, field: 'ativo', 'error')} ">
	<label for="ativo">
		<g:message code="aluno.ativo.label" default="Ativo" />
		
	</label>
	<g:checkBox name="ativo" value="${alunoInstance?.ativo}" />
</div>

<div class="fieldcontain ${hasErrors(bean: alunoInstance, field: 'historicos', 'error')} ">
	<label for="historicos">
		<g:message code="aluno.historicos.label" default="Historicos" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${alunoInstance?.historicos?}" var="h">
    <li><g:link controller="historico" action="show" id="${h.id}">${h?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="historico" action="create" params="['aluno.id': alunoInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'historico.label', default: 'Historico')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: alunoInstance, field: 'horarioDisponivel', 'error')} ">
	<label for="horarioDisponivel">
		<g:message code="aluno.horarioDisponivel.label" default="Horario Disponivel" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${alunoInstance?.horarioDisponivel?}" var="h">
    <li><g:link controller="horarioAluno" action="show" id="${h.id}">${h?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="horarioAluno" action="create" params="['aluno.id': alunoInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'horarioAluno.label', default: 'HorarioAluno')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: alunoInstance, field: 'turmas', 'error')} ">
	<label for="turmas">
		<g:message code="aluno.turmas.label" default="Turmas" />
		
	</label>
	<g:select name="turmas" from="${allocator.Turma.list()}" multiple="multiple" optionKey="id" size="5" value="${alunoInstance?.turmas*.id}" class="many-to-many"/>
</div>

<div class="span8">
	<table class="table table-bordered">
		<thead>
			<tr>
				<th>Horários</th>
				<th>Seg</th>
				<th>Ter</th>
				<th>Qua</th>
				<th>Qui</th>
				<th>Sex</th>
				<th>Sab</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>18:30/19:20</td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
			</tr>
			<tr>
				<td>19:20/20:10</td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>							
			</tr>
			<tr>
				<td>20:20/21:10</td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>							
			</tr>												
			<tr>
				<td>21:10/22:00</td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
			</tr>												
		</tbody>
	</table>
</div>

